package com.itzhigui.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 测试定时任务
 *
 * @author java1412
 * @since 2024-04-15 15:43:29
 */
@Component
public class MyTask1 {

    // @Scheduled(cron = "* * * * * *") // 每秒中都会执行一次
    // @Scheduled(cron = "0,1,2,3,45 * * * * *") // 每秒中都会执行一次
    public void task() {
        System.out.println(new Date());
    }

}
